package com.wzy.exportexcel.excelTask.domain;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 报表任务表
 * @TableName excel_task
 */
@Data
public class ExcelTask implements Serializable {
    /**
     * 任务ID
     */
    private Long taskId;

    /**
     * 任务类型，0：导出，1：导入
     */
    private Integer taskType;

    /**
     * 处理状态，0：待处理，1：处理中，2：成功，3：失败
     */
    private Integer handleStatus;

    /**
     * excel链接
     */
    private String excelUrl;

    /**
     * 链路ID
     */
    private String traceId;

    /**
     * 请求参数
     */
    private String requestParams;

    /**
     * 异常类型
     */
    private String exceptionType;

    /**
     * 异常描述
     */
    private String errorMsg;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ExcelTask other = (ExcelTask) that;
        return (this.getTaskId() == null ? other.getTaskId() == null : this.getTaskId().equals(other.getTaskId()))
            && (this.getTaskType() == null ? other.getTaskType() == null : this.getTaskType().equals(other.getTaskType()))
            && (this.getHandleStatus() == null ? other.getHandleStatus() == null : this.getHandleStatus().equals(other.getHandleStatus()))
            && (this.getExcelUrl() == null ? other.getExcelUrl() == null : this.getExcelUrl().equals(other.getExcelUrl()))
            && (this.getTraceId() == null ? other.getTraceId() == null : this.getTraceId().equals(other.getTraceId()))
            && (this.getRequestParams() == null ? other.getRequestParams() == null : this.getRequestParams().equals(other.getRequestParams()))
            && (this.getExceptionType() == null ? other.getExceptionType() == null : this.getExceptionType().equals(other.getExceptionType()))
            && (this.getErrorMsg() == null ? other.getErrorMsg() == null : this.getErrorMsg().equals(other.getErrorMsg()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getTaskId() == null) ? 0 : getTaskId().hashCode());
        result = prime * result + ((getTaskType() == null) ? 0 : getTaskType().hashCode());
        result = prime * result + ((getHandleStatus() == null) ? 0 : getHandleStatus().hashCode());
        result = prime * result + ((getExcelUrl() == null) ? 0 : getExcelUrl().hashCode());
        result = prime * result + ((getTraceId() == null) ? 0 : getTraceId().hashCode());
        result = prime * result + ((getRequestParams() == null) ? 0 : getRequestParams().hashCode());
        result = prime * result + ((getExceptionType() == null) ? 0 : getExceptionType().hashCode());
        result = prime * result + ((getErrorMsg() == null) ? 0 : getErrorMsg().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", taskId=").append(taskId);
        sb.append(", taskType=").append(taskType);
        sb.append(", handleStatus=").append(handleStatus);
        sb.append(", excelUrl=").append(excelUrl);
        sb.append(", traceId=").append(traceId);
        sb.append(", requestParams=").append(requestParams);
        sb.append(", exceptionType=").append(exceptionType);
        sb.append(", errorMsg=").append(errorMsg);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}